package com.ayi.servlet.backstage; /**
 * @author Ayingzz
 * @create 2021/12/6 22:56
 */

import com.ayi.dao.userdao.DeleteUser;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;

@WebServlet(name = "deleteAdminServlet", value = "/deleteAdminServlet")
public class deleteAdminServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request, response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        if (new DeleteUser().deleteAdminInUsers(Integer.parseInt(request.getParameter("id")))) {
            response.sendRedirect("UserManageServlet");
        } else {

        }
    }
}
